<template>
    <div class="data-content" v-if="entitys.length > 0">
        <div v-loading="loading" v-for="(item, index) in entitys" :key="index">
            <div class="cx">
                <div class="title">{{item.corpName}}</div>
                <div class="pf">综合得分：{{item.sum}}分</div>
            </div>
            <!-- <div class="" v-for="(param, indexs) in item.params" :key="indexs">
                {{!!item.titles[param] ? `${item.titles[param]}：${item[param]}` : ``}}
            </div> -->
             <el-descriptions class="margin-top" title="" :column="1"  border>
                <el-descriptions-item v-for="(param, indexs) in item.params" :key="indexs" v-if="item.titles[param]">
                    <template slot="label">
                        {{item.titles[param]}}
                    </template>
                    {{item[param]}}
                </el-descriptions-item>
               
            </el-descriptions>

        </div>
        
    </div>

    <el-empty v-else :image="imgUrl" :image-size="400" description=""></el-empty>
</template>

<script>
export default {
    props: {
        companyName: {
            type: String,
            default: "",
        },
        projectId: {
            type: String,
            default: "",
        },
    },
    data: () => ({
        loading: false,
        entitys: [],
        pageNum: 1,
        pageSize: 10,
        total: null,
        zsDetial: [],

        imgUrl: require("../../img/wu.png"),
    }),
    methods: {
        // 获取 福建省建筑施工企业信用综合评价系统-信用评价 列表
        getList: function () {
            var that = this;
            this.$ajax({
                type: "get",
                url: `${that.$store.state.api.searchUrl}/searchfujian/fujian/score`,
                data: {
                    corpName: that.companyName,
                    projectId: that.projectId,
                },
                callback: function (data, res) {
                    // loading.close()
                    if(data.entitys.length > 0) {
                        that.entitys = data.entitys
                    }
                },
            });
        },
    },
    mounted() {
        this.getList();
    },
};
</script>

<style scoped lang="scss">
.data-content {
    padding:0px 15px;
    .cx{
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        .title{
            display: flex;
            line-height: 1.8;
            padding: 0px 0 0px 10px;
            position: relative;
            font-size: 15px;
            font-weight: bold;
            margin-bottom: 10px;
        }
        .title::before {
            position: absolute;
            left: 0;
            top: 50%;
            content: "";
            width: 5px;
            height: 16px;
            margin-top: -8px;
            background-color: #409eff;
        }
        .pf{
            font-size: 14px;
            font-weight: bold;
        }
    }
}
</style>
